15.4 Floating-Point Control Registers

Floating-Point Status Register (FSR)


Figure 15-7 shows the Floating-Point Status register (FSR), control register 31 in Coprocessor 1. It is implemented in the graduation unit rather than the Floating-Point Unit, because it is closely tied to the active list.

Bits 22:18 are unimplemented and must be set to zero. All other bits may be read or written using Control Move instructions from or to Coprocessor 1 (subfunctions CFC1 or CTC1). These move instructions are fully interlocked; they are delayed in the decode stage until all previous instructions have been graduated, and no subsequent instruction is decoded until they have been completed.



Figure 15-7 Floating-Point Status Register (FSR)

Bit Descriptions of the FSR

Description of the bits in the FSR are as follows:

Condition Bits [31:25,23]: The Condition bits indicate the result of floating-point compare instructions. The active list keeps track of these bits.

Cause Bits [17:12]: Each functional unit can detect exceptional cases in their function codes, operands, or results. These cases are indicated by setting one of six specific Cause bits. The Cause bits indicate the status of the floating-point arithmetic instruction which graduated most recently or caused an exception to be taken. The FSR is not modified by load, store, or move instructions. All cause bits, except E, have corresponding Enable and Flag bits in the FSR.

E Unimplemented operation: the execution unit does not perform the specified operation. This exception is always enabled.

V Invalid operation: this operation is not valid for the given operands.

Z Division by zero: (divide unit only) the result of division by zero is not defined.

O Overflow: the result is too large in magnitude to be correctly represented in the result format.

U Underflow: the result is too small in magnitude to be correctly represented in the result format.

I Inexact Result: the result cannot be represented exactly.


NOTE: The FSR is modified only for instructions issued by the floating-point queue. Move From (MFC or DMFC) instructions never set the Cause field; status bits from the functional unit (multiplier) must be ignored. Move or Move Conditional instructions can set the Unimplemented Operation exception only in the Cause field. Load and store instructions are issued by the address queue.)


The functional units generate the Cause bits and send them to the graduation unit when the operation is completed.

Enable Bits [11:7]: The five Enable bits individually enable (when set to a 1) or disable (when set to a 0) exceptions when the corresponding Cause bit is set.

Flag Bits [6:2]: One of the five Flag bits is set when a floating-point arithmetic instruction graduates, if the corresponding Cause bit is set. The Flag bits are sticky and remain set until the FSR is written. Thus, the Flag bits indicate the status of all floating-point instructions graduated since the FSR was last written. The Flag bits are not modified for any instructions which cause an exception to be taken.

Round Mode [1:0]: RM bits select one of the four IEEE rounding modes. Most floating-point results cannot be precisely represented by the 32-bit or 64-bit register formats, and must be truncated and rounded to a representable value. The modes selected by the RM bit values are:

0: RN, round to nearest representable value. If two values are equally near, set the lowest bit to zero.

1: RZ, round toward zero. Round to the closest value whose magnitude is not greater than the result.

2: RP, round to plus infinity. Round to the closest value whose magnitude is not less than the result.

3: RM, round to minus infinity. Round to the closest value whose magnitude is not greater.

The Round and Enable bits only change when the FSR is written by a CTC1 (Move To Coprocessor 1 Control Register) instruction. Each CTC1 instruction is executed sequentially, after all previous floating-point instructions have been completed, so these FSR bits do not change while any floating-point instruction is active. These bits are broadcast from the graduation unit to all the floating-point functional units.

When a Cause bit is set and its corresponding Enable bit is also set, an exception is taken on the instruction. The result of the instruction is not stored, and the Flag bits are not changed. If no exception is taken, the corresponding Flag bits are set.

The Cause and Flag bits may be read or written. If a CTC1 instruction sets both a Cause bit and its Enable bit, an exception is taken immediately. The FSR is written, but the exception is reported on the move instruction.

Loading the FSR

The FSR may be loaded from an integer register by a CTC1 instruction which selects control register 31. This instruction is executed serially; that is, it is delayed during decode until the entire pipeline has emptied, and it is completed before the next instruction is decoded. This instruction writes all FSR bits.

If any Cause bit and its corresponding Enable bit are both set, an exception is taken after FSR has been modified. The CTC1 instruction is aborted; it does not graduate, even though it has changed the processor state.




Copyright 1995, MIPS Technologies, Inc. -- 29 JAN 96


Generated with CERN WebMaker